package com.acyouzi.huawei;

import java.util.*;

/**
 * 17/9/26 19:33
 *
 * @author sunxu
 */
public class Main3 {
  public static void main(String[] args) {
    final Scanner in = new Scanner(System.in);
    final String str = in.nextLine();
    String[] names = str.split("\\|");
    List<String> lists = new ArrayList<>();
    for (String tmp : names) lists.add(tmp);
    Collections.sort(lists, new Comparator<String>() {
      @Override
      public int compare(String o1, String o2) {
        String[] str1 = o1.split("\\.");
        String[] str2 = o2.split("\\.");
        int index = 0;
        int tmp1 = str1.length -1;
        int tmp2 = str2.length -1;
        while (index < str1.length && index < str2.length){
          if (!str1[tmp1 - index].equals(str2[tmp2 - index])){
            return str1[tmp1 - index].compareTo(str2[tmp2 - index]);
          }
          index ++;
        }
        if (index == str1.length) return -1;
        if (index == str2.length) return 1;
        return 0;
      }
    });
    for (int i = 0; i < lists.size(); i++) {
      System.out.print(lists.get(i));
      if (i != lists.size()-1) System.out.print("|");
    }
  }
}
